<?php

namespace App\Service\Impl;

if (!defined('IN_PX'))
    exit;

use App\Service\Product;
use App\Repository;
use App\Tools\Auxi;

class ProductImpl implements Product {

    //服务层组件
    private function __Service($value = 'product') {}

    private function __Value($cfg, $setting, $__ROOT__, $__CDN__, $__PACKAGE__, $__LANGUAGE_CONFIG__, $__LANGUAGE_ID__, $__ASSETS__) {}

    private function __Inject($cache, Repository\Product $repoPro) {}

    public function productType() {

        $product = $this->cache->get('productType');
        if ($product == null) {
            $return = $this->repoPro->productType();
            $this->cache->set('productType', $return);
            return $return;
        }
        return $product;
    }

    public function productCount($id, $search = null) {
        $return = $this->repoPro->findProductCount($id, $search);
        return $return;
    }

    public function findProductAll($id, $search = null, $start = null, $end = null) {
        $return = $this->repoPro->findProductAll($id, $search, $start, $end);
        return $return;
    }

    public function findProductDetail($id) {
        $return = $this->repoPro->findProductDetail($id);
        return $return;
    }

    public function findProductLike($id) {
        $return = $this->repoPro->findProductLike($id);
        return $return;
    }



}
